{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "ri = pd.read_csv('police.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "ted = pd.read_csv('ted.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x26a2192bfd0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VPW9N/DPl30nLBERLMGKAmoVTV1Kr4+K1gUr1mrrbZ+KW3263N4uT6/FunS5VujjjvqouIK1bqBiZd9lEwiLLAkkAUISErJBFrJP8r1/zJlkEmY7y2wnn/frlVdmzpzlN2fOfOd3fquoKoiIyL26xTsBREQUXQz0REQux0BPRORyDPRERC7HQE9E5HIM9ERELsdAT0Tkcgz0REQux0BPRORyPeKdAAAYPny4pqWlxTsZRERJZfv27eWqmhpuvYQI9GlpacjIyIh3MoiIkoqIHIlkPRbdEBG5HAM9EZHLhQ30IvKmiJSKyF6/ZUNFZIWI5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Zi26IiCgCDPRERC7HQE9E5HIM9ERELsdAT0Tkcgz0REQux0BPRORyDPRERC73PwBvgrapj+0dAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ri.driver_age.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>stop_date</th>\n",
       "      <th>stop_time</th>\n",
       "      <th>county_name</th>\n",
       "      <th>driver_gender</th>\n",
       "      <th>driver_age_raw</th>\n",
       "      <th>driver_age</th>\n",
       "      <th>driver_race</th>\n",
       "      <th>violation_raw</th>\n",
       "      <th>violation</th>\n",
       "      <th>search_conducted</th>\n",
       "      <th>search_type</th>\n",
       "      <th>stop_outcome</th>\n",
       "      <th>is_arrested</th>\n",
       "      <th>stop_duration</th>\n",
       "      <th>drugs_related_stop</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2005-01-02</td>\n",
       "      <td>01:55</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1985.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2005-01-18</td>\n",
       "      <td>08:15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1965.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2005-01-23</td>\n",
       "      <td>23:15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1972.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2005-02-20</td>\n",
       "      <td>17:15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1986.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Call for Service</td>\n",
       "      <td>Other</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Arrest Driver</td>\n",
       "      <td>True</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2005-03-14</td>\n",
       "      <td>10:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1984.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2005-03-23</td>\n",
       "      <td>09:45</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1982.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>Black</td>\n",
       "      <td>Equipment/Inspection Violation</td>\n",
       "      <td>Equipment</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2005-04-01</td>\n",
       "      <td>17:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1969.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2005-06-06</td>\n",
       "      <td>13:20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1986.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2005-07-13</td>\n",
       "      <td>10:15</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1970.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>Black</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2005-07-13</td>\n",
       "      <td>15:45</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1970.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2005-07-13</td>\n",
       "      <td>16:20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1979.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>Asian</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2005-07-13</td>\n",
       "      <td>19:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1966.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2005-07-14</td>\n",
       "      <td>19:55</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1979.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2005-07-18</td>\n",
       "      <td>19:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1984.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2005-07-18</td>\n",
       "      <td>19:45</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1969.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2005-07-19</td>\n",
       "      <td>00:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1982.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2005-07-19</td>\n",
       "      <td>00:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1982.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2005-07-19</td>\n",
       "      <td>23:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1979.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Equipment/Inspection Violation</td>\n",
       "      <td>Equipment</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2005-07-20</td>\n",
       "      <td>00:05</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1955.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2005-07-24</td>\n",
       "      <td>20:10</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1958.0</td>\n",
       "      <td>47.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2005-07-28</td>\n",
       "      <td>12:37</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1979.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>Asian</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2005-08-07</td>\n",
       "      <td>16:50</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1953.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2005-08-08</td>\n",
       "      <td>02:09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1955.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>Black</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Arrest Driver</td>\n",
       "      <td>True</td>\n",
       "      <td>30+ Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2005-08-18</td>\n",
       "      <td>10:57</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1967.0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2005-08-28</td>\n",
       "      <td>01:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1979.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>True</td>\n",
       "      <td>Incident to Arrest,Protective Frisk</td>\n",
       "      <td>Arrest Driver</td>\n",
       "      <td>True</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2005-09-03</td>\n",
       "      <td>16:02</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2005-09-17</td>\n",
       "      <td>10:54</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1964.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2005-09-21</td>\n",
       "      <td>13:30</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1977.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2005-09-22</td>\n",
       "      <td>22:34</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1984.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2005-09-26</td>\n",
       "      <td>01:05</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91711</th>\n",
       "      <td>2015-12-30</td>\n",
       "      <td>15:42</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1974.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91712</th>\n",
       "      <td>2015-12-30</td>\n",
       "      <td>16:19</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1989.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91713</th>\n",
       "      <td>2015-12-30</td>\n",
       "      <td>17:07</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91714</th>\n",
       "      <td>2015-12-30</td>\n",
       "      <td>17:39</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1996.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91715</th>\n",
       "      <td>2015-12-30</td>\n",
       "      <td>23:26</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1994.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91716</th>\n",
       "      <td>2015-12-30</td>\n",
       "      <td>23:33</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1983.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Seatbelt Violation</td>\n",
       "      <td>Seat belt</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91717</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>00:00</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1993.0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91718</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>00:01</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1966.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91719</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>06:31</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1989.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91720</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>06:32</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1975.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91721</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>06:49</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1943.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91722</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>07:06</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1970.0</td>\n",
       "      <td>45.0</td>\n",
       "      <td>Black</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91723</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>07:14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1978.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Registration Violation</td>\n",
       "      <td>Registration/plates</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91724</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>07:27</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1997.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91725</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>08:14</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1960.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91726</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>08:41</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1992.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>No Action</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91727</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>09:17</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1995.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91728</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>13:50</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1982.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91729</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>14:21</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1988.0</td>\n",
       "      <td>27.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Equipment/Inspection Violation</td>\n",
       "      <td>Equipment</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91730</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>15:36</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1996.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Equipment/Inspection Violation</td>\n",
       "      <td>Equipment</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91731</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>16:38</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1988.0</td>\n",
       "      <td>27.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91732</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>19:44</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1969.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91733</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>19:55</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1974.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Registration Violation</td>\n",
       "      <td>Registration/plates</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91734</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:20</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1993.0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91735</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1992.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91736</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:27</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1986.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91737</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1982.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Equipment/Inspection Violation</td>\n",
       "      <td>Equipment</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91738</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:45</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1992.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91739</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>21:42</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1993.0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91740</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>22:46</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1959.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91741 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        stop_date stop_time  county_name driver_gender  driver_age_raw  \\\n",
       "0      2005-01-02     01:55          NaN             M          1985.0   \n",
       "1      2005-01-18     08:15          NaN             M          1965.0   \n",
       "2      2005-01-23     23:15          NaN             M          1972.0   \n",
       "3      2005-02-20     17:15          NaN             M          1986.0   \n",
       "4      2005-03-14     10:00          NaN             F          1984.0   \n",
       "5      2005-03-23     09:45          NaN             M          1982.0   \n",
       "6      2005-04-01     17:30          NaN             M          1969.0   \n",
       "7      2005-06-06     13:20          NaN             F          1986.0   \n",
       "8      2005-07-13     10:15          NaN             M          1970.0   \n",
       "9      2005-07-13     15:45          NaN             M          1970.0   \n",
       "10     2005-07-13     16:20          NaN             M          1979.0   \n",
       "11     2005-07-13     19:00          NaN             F          1966.0   \n",
       "12     2005-07-14     19:55          NaN             M          1979.0   \n",
       "13     2005-07-18     19:30          NaN             F          1984.0   \n",
       "14     2005-07-18     19:45          NaN             M          1969.0   \n",
       "15     2005-07-19     00:30          NaN             M          1982.0   \n",
       "16     2005-07-19     00:30          NaN             M          1982.0   \n",
       "17     2005-07-19     23:30          NaN             M          1979.0   \n",
       "18     2005-07-20     00:05          NaN             M          1955.0   \n",
       "19     2005-07-24     20:10          NaN             F          1958.0   \n",
       "20     2005-07-28     12:37          NaN             F          1979.0   \n",
       "21     2005-08-07     16:50          NaN             M          1953.0   \n",
       "22     2005-08-08     02:09          NaN             M          1955.0   \n",
       "23     2005-08-18     10:57          NaN             F          1967.0   \n",
       "24     2005-08-28     01:00          NaN             M          1979.0   \n",
       "25     2005-09-03     16:02          NaN           NaN             NaN   \n",
       "26     2005-09-17     10:54          NaN             M          1964.0   \n",
       "27     2005-09-21     13:30          NaN             F          1977.0   \n",
       "28     2005-09-22     22:34          NaN             M          1984.0   \n",
       "29     2005-09-26     01:05          NaN           NaN             NaN   \n",
       "...           ...       ...          ...           ...             ...   \n",
       "91711  2015-12-30     15:42          NaN             M          1974.0   \n",
       "91712  2015-12-30     16:19          NaN             F          1989.0   \n",
       "91713  2015-12-30     17:07          NaN           NaN             NaN   \n",
       "91714  2015-12-30     17:39          NaN             M          1996.0   \n",
       "91715  2015-12-30     23:26          NaN             F          1994.0   \n",
       "91716  2015-12-30     23:33          NaN             F          1983.0   \n",
       "91717  2015-12-31     00:00          NaN             F          1993.0   \n",
       "91718  2015-12-31     00:01          NaN             M          1966.0   \n",
       "91719  2015-12-31     06:31          NaN             M          1989.0   \n",
       "91720  2015-12-31     06:32          NaN             M          1975.0   \n",
       "91721  2015-12-31     06:49          NaN             M          1943.0   \n",
       "91722  2015-12-31     07:06          NaN             M          1970.0   \n",
       "91723  2015-12-31     07:14          NaN             M          1978.0   \n",
       "91724  2015-12-31     07:27          NaN             M          1997.0   \n",
       "91725  2015-12-31     08:14          NaN             F          1960.0   \n",
       "91726  2015-12-31     08:41          NaN             M          1992.0   \n",
       "91727  2015-12-31     09:17          NaN             F          1995.0   \n",
       "91728  2015-12-31     13:50          NaN             F          1982.0   \n",
       "91729  2015-12-31     14:21          NaN             F          1988.0   \n",
       "91730  2015-12-31     15:36          NaN             F          1996.0   \n",
       "91731  2015-12-31     16:38          NaN             F          1988.0   \n",
       "91732  2015-12-31     19:44          NaN             F          1969.0   \n",
       "91733  2015-12-31     19:55          NaN             F          1974.0   \n",
       "91734  2015-12-31     20:20          NaN             M          1993.0   \n",
       "91735  2015-12-31     20:25          NaN             M          1992.0   \n",
       "91736  2015-12-31     20:27          NaN             M          1986.0   \n",
       "91737  2015-12-31     20:35          NaN             F          1982.0   \n",
       "91738  2015-12-31     20:45          NaN             M          1992.0   \n",
       "91739  2015-12-31     21:42          NaN             M          1993.0   \n",
       "91740  2015-12-31     22:46          NaN             M          1959.0   \n",
       "\n",
       "       driver_age driver_race                   violation_raw  \\\n",
       "0            20.0       White                        Speeding   \n",
       "1            40.0       White                        Speeding   \n",
       "2            33.0       White                        Speeding   \n",
       "3            19.0       White                Call for Service   \n",
       "4            21.0       White                        Speeding   \n",
       "5            23.0       Black  Equipment/Inspection Violation   \n",
       "6            36.0       White                        Speeding   \n",
       "7            19.0       White                        Speeding   \n",
       "8            35.0       Black                        Speeding   \n",
       "9            35.0       White                        Speeding   \n",
       "10           26.0       Asian                        Speeding   \n",
       "11           39.0       White                        Speeding   \n",
       "12           26.0       White                        Speeding   \n",
       "13           21.0       White                        Speeding   \n",
       "14           36.0       White                        Speeding   \n",
       "15           23.0       White                        Speeding   \n",
       "16           23.0       White                        Speeding   \n",
       "17           26.0       White  Equipment/Inspection Violation   \n",
       "18           50.0       White                        Speeding   \n",
       "19           47.0       White                        Speeding   \n",
       "20           26.0       Asian                        Speeding   \n",
       "21           52.0       White         Other Traffic Violation   \n",
       "22           50.0       Black         Other Traffic Violation   \n",
       "23           38.0       White                        Speeding   \n",
       "24           26.0       White         Other Traffic Violation   \n",
       "25            NaN         NaN                             NaN   \n",
       "26           41.0       White                        Speeding   \n",
       "27           28.0       White                        Speeding   \n",
       "28           21.0       White                        Speeding   \n",
       "29            NaN         NaN                             NaN   \n",
       "...           ...         ...                             ...   \n",
       "91711        41.0       White                        Speeding   \n",
       "91712        26.0       White                        Speeding   \n",
       "91713         NaN         NaN                             NaN   \n",
       "91714        19.0    Hispanic                        Speeding   \n",
       "91715        21.0    Hispanic                        Speeding   \n",
       "91716        32.0    Hispanic              Seatbelt Violation   \n",
       "91717        22.0       White                        Speeding   \n",
       "91718        49.0       White         Other Traffic Violation   \n",
       "91719        26.0       White         Other Traffic Violation   \n",
       "91720        40.0       White                        Speeding   \n",
       "91721        72.0       White                        Speeding   \n",
       "91722        45.0       Black                        Speeding   \n",
       "91723        37.0    Hispanic          Registration Violation   \n",
       "91724        18.0       White                        Speeding   \n",
       "91725        55.0       White                        Speeding   \n",
       "91726        23.0       White                        Speeding   \n",
       "91727        20.0       White                        Speeding   \n",
       "91728        33.0    Hispanic                        Speeding   \n",
       "91729        27.0       White  Equipment/Inspection Violation   \n",
       "91730        19.0    Hispanic  Equipment/Inspection Violation   \n",
       "91731        27.0       White                        Speeding   \n",
       "91732        46.0       White                        Speeding   \n",
       "91733        41.0       White          Registration Violation   \n",
       "91734        22.0       White                        Speeding   \n",
       "91735        23.0    Hispanic                        Speeding   \n",
       "91736        29.0       White                        Speeding   \n",
       "91737        33.0       White  Equipment/Inspection Violation   \n",
       "91738        23.0       White         Other Traffic Violation   \n",
       "91739        22.0       White                        Speeding   \n",
       "91740        56.0    Hispanic                        Speeding   \n",
       "\n",
       "                 violation  search_conducted  \\\n",
       "0                 Speeding             False   \n",
       "1                 Speeding             False   \n",
       "2                 Speeding             False   \n",
       "3                    Other             False   \n",
       "4                 Speeding             False   \n",
       "5                Equipment             False   \n",
       "6                 Speeding             False   \n",
       "7                 Speeding             False   \n",
       "8                 Speeding             False   \n",
       "9                 Speeding             False   \n",
       "10                Speeding             False   \n",
       "11                Speeding             False   \n",
       "12                Speeding             False   \n",
       "13                Speeding             False   \n",
       "14                Speeding             False   \n",
       "15                Speeding             False   \n",
       "16                Speeding             False   \n",
       "17               Equipment             False   \n",
       "18                Speeding             False   \n",
       "19                Speeding             False   \n",
       "20                Speeding             False   \n",
       "21        Moving violation             False   \n",
       "22        Moving violation             False   \n",
       "23                Speeding             False   \n",
       "24        Moving violation              True   \n",
       "25                     NaN             False   \n",
       "26                Speeding             False   \n",
       "27                Speeding             False   \n",
       "28                Speeding             False   \n",
       "29                     NaN             False   \n",
       "...                    ...               ...   \n",
       "91711             Speeding             False   \n",
       "91712             Speeding             False   \n",
       "91713                  NaN             False   \n",
       "91714             Speeding             False   \n",
       "91715             Speeding             False   \n",
       "91716            Seat belt             False   \n",
       "91717             Speeding             False   \n",
       "91718     Moving violation             False   \n",
       "91719     Moving violation             False   \n",
       "91720             Speeding             False   \n",
       "91721             Speeding             False   \n",
       "91722             Speeding             False   \n",
       "91723  Registration/plates             False   \n",
       "91724             Speeding             False   \n",
       "91725             Speeding             False   \n",
       "91726             Speeding             False   \n",
       "91727             Speeding             False   \n",
       "91728             Speeding             False   \n",
       "91729            Equipment             False   \n",
       "91730            Equipment             False   \n",
       "91731             Speeding             False   \n",
       "91732             Speeding             False   \n",
       "91733  Registration/plates             False   \n",
       "91734             Speeding             False   \n",
       "91735             Speeding             False   \n",
       "91736             Speeding             False   \n",
       "91737            Equipment             False   \n",
       "91738     Moving violation             False   \n",
       "91739             Speeding             False   \n",
       "91740             Speeding             False   \n",
       "\n",
       "                               search_type   stop_outcome is_arrested  \\\n",
       "0                                      NaN       Citation       False   \n",
       "1                                      NaN       Citation       False   \n",
       "2                                      NaN       Citation       False   \n",
       "3                                      NaN  Arrest Driver        True   \n",
       "4                                      NaN       Citation       False   \n",
       "5                                      NaN       Citation       False   \n",
       "6                                      NaN       Citation       False   \n",
       "7                                      NaN       Citation       False   \n",
       "8                                      NaN       Citation       False   \n",
       "9                                      NaN       Citation       False   \n",
       "10                                     NaN       Citation       False   \n",
       "11                                     NaN       Citation       False   \n",
       "12                                     NaN       Citation       False   \n",
       "13                                     NaN       Citation       False   \n",
       "14                                     NaN       Citation       False   \n",
       "15                                     NaN       Citation       False   \n",
       "16                                     NaN       Citation       False   \n",
       "17                                     NaN       Citation       False   \n",
       "18                                     NaN       Citation       False   \n",
       "19                                     NaN       Citation       False   \n",
       "20                                     NaN       Citation       False   \n",
       "21                                     NaN       Citation       False   \n",
       "22                                     NaN  Arrest Driver        True   \n",
       "23                                     NaN       Citation       False   \n",
       "24     Incident to Arrest,Protective Frisk  Arrest Driver        True   \n",
       "25                                     NaN            NaN         NaN   \n",
       "26                                     NaN       Citation       False   \n",
       "27                                     NaN       Citation       False   \n",
       "28                                     NaN       Citation       False   \n",
       "29                                     NaN            NaN         NaN   \n",
       "...                                    ...            ...         ...   \n",
       "91711                                  NaN       Citation       False   \n",
       "91712                                  NaN       Citation       False   \n",
       "91713                                  NaN            NaN         NaN   \n",
       "91714                                  NaN       Citation       False   \n",
       "91715                                  NaN       Citation       False   \n",
       "91716                                  NaN       Citation       False   \n",
       "91717                                  NaN       Citation       False   \n",
       "91718                                  NaN       Citation       False   \n",
       "91719                                  NaN       Citation       False   \n",
       "91720                                  NaN       Citation       False   \n",
       "91721                                  NaN        Warning       False   \n",
       "91722                                  NaN       Citation       False   \n",
       "91723                                  NaN       Citation       False   \n",
       "91724                                  NaN       Citation       False   \n",
       "91725                                  NaN       Citation       False   \n",
       "91726                                  NaN      No Action       False   \n",
       "91727                                  NaN        Warning       False   \n",
       "91728                                  NaN       Citation       False   \n",
       "91729                                  NaN       Citation       False   \n",
       "91730                                  NaN        Warning       False   \n",
       "91731                                  NaN       Citation       False   \n",
       "91732                                  NaN        Warning       False   \n",
       "91733                                  NaN       Citation       False   \n",
       "91734                                  NaN       Citation       False   \n",
       "91735                                  NaN       Citation       False   \n",
       "91736                                  NaN        Warning       False   \n",
       "91737                                  NaN        Warning       False   \n",
       "91738                                  NaN        Warning       False   \n",
       "91739                                  NaN       Citation       False   \n",
       "91740                                  NaN       Citation       False   \n",
       "\n",
       "      stop_duration  drugs_related_stop  \n",
       "0          0-15 Min               False  \n",
       "1          0-15 Min               False  \n",
       "2          0-15 Min               False  \n",
       "3         16-30 Min               False  \n",
       "4          0-15 Min               False  \n",
       "5          0-15 Min               False  \n",
       "6          0-15 Min               False  \n",
       "7          0-15 Min               False  \n",
       "8          0-15 Min               False  \n",
       "9          0-15 Min               False  \n",
       "10         0-15 Min               False  \n",
       "11         0-15 Min               False  \n",
       "12         0-15 Min               False  \n",
       "13         0-15 Min               False  \n",
       "14         0-15 Min               False  \n",
       "15         0-15 Min               False  \n",
       "16         0-15 Min               False  \n",
       "17         0-15 Min               False  \n",
       "18         0-15 Min               False  \n",
       "19         0-15 Min               False  \n",
       "20         0-15 Min               False  \n",
       "21         0-15 Min               False  \n",
       "22          30+ Min               False  \n",
       "23         0-15 Min               False  \n",
       "24        16-30 Min               False  \n",
       "25              NaN               False  \n",
       "26         0-15 Min               False  \n",
       "27         0-15 Min               False  \n",
       "28         0-15 Min               False  \n",
       "29              NaN               False  \n",
       "...             ...                 ...  \n",
       "91711     16-30 Min               False  \n",
       "91712      0-15 Min               False  \n",
       "91713           NaN               False  \n",
       "91714     16-30 Min               False  \n",
       "91715      0-15 Min               False  \n",
       "91716      0-15 Min               False  \n",
       "91717      0-15 Min               False  \n",
       "91718      0-15 Min               False  \n",
       "91719      0-15 Min               False  \n",
       "91720     16-30 Min               False  \n",
       "91721      0-15 Min               False  \n",
       "91722      0-15 Min               False  \n",
       "91723      0-15 Min               False  \n",
       "91724      0-15 Min               False  \n",
       "91725      0-15 Min               False  \n",
       "91726      0-15 Min               False  \n",
       "91727     16-30 Min               False  \n",
       "91728      0-15 Min               False  \n",
       "91729      0-15 Min               False  \n",
       "91730      0-15 Min               False  \n",
       "91731      0-15 Min               False  \n",
       "91732      0-15 Min               False  \n",
       "91733      0-15 Min               False  \n",
       "91734      0-15 Min               False  \n",
       "91735      0-15 Min               False  \n",
       "91736      0-15 Min               False  \n",
       "91737      0-15 Min               False  \n",
       "91738      0-15 Min               False  \n",
       "91739      0-15 Min               False  \n",
       "91740      0-15 Min               False  \n",
       "\n",
       "[91741 rows x 15 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(91741, 15)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>stop_date</th>\n",
       "      <th>stop_time</th>\n",
       "      <th>county_name</th>\n",
       "      <th>driver_gender</th>\n",
       "      <th>driver_age_raw</th>\n",
       "      <th>driver_age</th>\n",
       "      <th>driver_race</th>\n",
       "      <th>violation_raw</th>\n",
       "      <th>violation</th>\n",
       "      <th>search_conducted</th>\n",
       "      <th>search_type</th>\n",
       "      <th>stop_outcome</th>\n",
       "      <th>is_arrested</th>\n",
       "      <th>stop_duration</th>\n",
       "      <th>drugs_related_stop</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>91736</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:27</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1986.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91737</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:35</td>\n",
       "      <td>NaN</td>\n",
       "      <td>F</td>\n",
       "      <td>1982.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Equipment/Inspection Violation</td>\n",
       "      <td>Equipment</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91738</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>20:45</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1992.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Other Traffic Violation</td>\n",
       "      <td>Moving violation</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Warning</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91739</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>21:42</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1993.0</td>\n",
       "      <td>22.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91740</th>\n",
       "      <td>2015-12-31</td>\n",
       "      <td>22:46</td>\n",
       "      <td>NaN</td>\n",
       "      <td>M</td>\n",
       "      <td>1959.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>Hispanic</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        stop_date stop_time  county_name driver_gender  driver_age_raw  \\\n",
       "91736  2015-12-31     20:27          NaN             M          1986.0   \n",
       "91737  2015-12-31     20:35          NaN             F          1982.0   \n",
       "91738  2015-12-31     20:45          NaN             M          1992.0   \n",
       "91739  2015-12-31     21:42          NaN             M          1993.0   \n",
       "91740  2015-12-31     22:46          NaN             M          1959.0   \n",
       "\n",
       "       driver_age driver_race                   violation_raw  \\\n",
       "91736        29.0       White                        Speeding   \n",
       "91737        33.0       White  Equipment/Inspection Violation   \n",
       "91738        23.0       White         Other Traffic Violation   \n",
       "91739        22.0       White                        Speeding   \n",
       "91740        56.0    Hispanic                        Speeding   \n",
       "\n",
       "              violation  search_conducted search_type stop_outcome  \\\n",
       "91736          Speeding             False         NaN      Warning   \n",
       "91737         Equipment             False         NaN      Warning   \n",
       "91738  Moving violation             False         NaN      Warning   \n",
       "91739          Speeding             False         NaN     Citation   \n",
       "91740          Speeding             False         NaN     Citation   \n",
       "\n",
       "      is_arrested stop_duration  drugs_related_stop  \n",
       "91736       False      0-15 Min               False  \n",
       "91737       False      0-15 Min               False  \n",
       "91738       False      0-15 Min               False  \n",
       "91739       False      0-15 Min               False  \n",
       "91740       False      0-15 Min               False  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "stop_date                 0\n",
       "stop_time                 0\n",
       "driver_gender          5335\n",
       "driver_age_raw         5327\n",
       "driver_age             5621\n",
       "driver_race            5333\n",
       "violation_raw          5333\n",
       "violation              5333\n",
       "search_conducted          0\n",
       "search_type           88545\n",
       "stop_outcome           5333\n",
       "is_arrested            5333\n",
       "stop_duration          5333\n",
       "drugs_related_stop        0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "ri.drop('county_name',axis='columns',inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(91741, 14)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>stop_date</th>\n",
       "      <th>stop_time</th>\n",
       "      <th>driver_gender</th>\n",
       "      <th>driver_age_raw</th>\n",
       "      <th>driver_age</th>\n",
       "      <th>driver_race</th>\n",
       "      <th>violation_raw</th>\n",
       "      <th>violation</th>\n",
       "      <th>search_conducted</th>\n",
       "      <th>search_type</th>\n",
       "      <th>stop_outcome</th>\n",
       "      <th>is_arrested</th>\n",
       "      <th>stop_duration</th>\n",
       "      <th>drugs_related_stop</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2005-01-02</td>\n",
       "      <td>01:55</td>\n",
       "      <td>M</td>\n",
       "      <td>1985.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2005-01-18</td>\n",
       "      <td>08:15</td>\n",
       "      <td>M</td>\n",
       "      <td>1965.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2005-01-23</td>\n",
       "      <td>23:15</td>\n",
       "      <td>M</td>\n",
       "      <td>1972.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2005-02-20</td>\n",
       "      <td>17:15</td>\n",
       "      <td>M</td>\n",
       "      <td>1986.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Call for Service</td>\n",
       "      <td>Other</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Arrest Driver</td>\n",
       "      <td>True</td>\n",
       "      <td>16-30 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2005-03-14</td>\n",
       "      <td>10:00</td>\n",
       "      <td>F</td>\n",
       "      <td>1984.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>White</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>Speeding</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Citation</td>\n",
       "      <td>False</td>\n",
       "      <td>0-15 Min</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    stop_date stop_time driver_gender  driver_age_raw  driver_age driver_race  \\\n",
       "0  2005-01-02     01:55             M          1985.0        20.0       White   \n",
       "1  2005-01-18     08:15             M          1965.0        40.0       White   \n",
       "2  2005-01-23     23:15             M          1972.0        33.0       White   \n",
       "3  2005-02-20     17:15             M          1986.0        19.0       White   \n",
       "4  2005-03-14     10:00             F          1984.0        21.0       White   \n",
       "\n",
       "      violation_raw violation  search_conducted search_type   stop_outcome  \\\n",
       "0          Speeding  Speeding             False         NaN       Citation   \n",
       "1          Speeding  Speeding             False         NaN       Citation   \n",
       "2          Speeding  Speeding             False         NaN       Citation   \n",
       "3  Call for Service     Other             False         NaN  Arrest Driver   \n",
       "4          Speeding  Speeding             False         NaN       Citation   \n",
       "\n",
       "  is_arrested stop_duration  drugs_related_stop  \n",
       "0       False      0-15 Min               False  \n",
       "1       False      0-15 Min               False  \n",
       "2       False      0-15 Min               False  \n",
       "3        True     16-30 Min               False  \n",
       "4       False      0-15 Min               False  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(91741, 14)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.dropna(axis='columns',how='all').shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['stop_date', 'stop_time', 'driver_gender', 'driver_age_raw',\n",
       "       'driver_age', 'driver_race', 'violation_raw', 'violation',\n",
       "       'search_conducted', 'search_type', 'stop_outcome', 'is_arrested',\n",
       "       'stop_duration', 'drugs_related_stop'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "stop_date              object\n",
       "stop_time              object\n",
       "driver_gender          object\n",
       "driver_age_raw        float64\n",
       "driver_age            float64\n",
       "driver_race            object\n",
       "violation_raw          object\n",
       "violation              object\n",
       "search_conducted         bool\n",
       "search_type            object\n",
       "stop_outcome           object\n",
       "is_arrested            object\n",
       "stop_duration          object\n",
       "drugs_related_stop       bool\n",
       "dtype: object"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(91741, 14)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "M    0.680527\n",
       "F    0.319473\n",
       "Name: driver_gender, dtype: float64"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri[ri.violation == 'Speeding'].driver_gender.value_counts(normalize=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Speeding               0.524350\n",
       "Moving violation       0.207012\n",
       "Equipment              0.135671\n",
       "Other                  0.057668\n",
       "Registration/plates    0.038461\n",
       "Seat belt              0.036839\n",
       "Name: violation, dtype: float64"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri[ri.driver_gender == 'M'].violation.value_counts(normalize=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Speeding               0.658500\n",
       "Moving violation       0.136277\n",
       "Equipment              0.105780\n",
       "Registration/plates    0.043086\n",
       "Other                  0.029348\n",
       "Seat belt              0.027009\n",
       "Name: violation, dtype: float64"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri[ri.driver_gender == 'F'].violation.value_counts(normalize=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "driver_gender\n",
       "F    0.65850\n",
       "M    0.52435\n",
       "Name: violation, dtype: float64"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ri.groupby('driver_gender').violation.value_counts(normalize=True).loc[:,'Speeding']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
